home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / archiver / unix / zip19p1.zoo / zip.doc < prev    next >
Text File  |  1992-08-26  |  24KB  |  529 lines

  1.  
  2. ZIP(1)                   USER COMMANDS                     ZIP(1)
  3.  
  4. NAME
  5.      zip, zipcloak, zipnote,  zipsplit  -  package  and  compress
  6.      (archive) files
  7.  
  8. SYNOPSIS
  9.      zip [ -cdeEfghjklmoqruwyz@ ] [ -b temppath ] [ -n suffixes ]
  10.      [ -t mmddyy ] [ zipfile list ] [ -x list ]
  11.  
  12.      zipcloak [ -d ] [ -b path ] zipfile
  13.  
  14.      zipnote [ -w ] [ -b path ] zipfile
  15.  
  16.      zipsplit [ -ti ] [ -n size ] [ -b path ] zipfile
  17.  
  18. DESCRIPTION
  19.      zip is a compression and file packaging  utility  for  Unix,
  20.      VMS,  MSDOS,  OS/2,  Windows NT, Minix, Atari and Macintosh.
  21.      It is analogous to a combination of tar and compress and  is
  22.      compatible with PKZIP (Phil Katz ZIP) for MSDOS systems.
  23.  
  24.      There is a companion to zip called unzip (of  course)  which
  25.      you  should  be able to find the same place you got zip. zip
  26.      and unzip can work with files produced by PKZIP under MSDOS,
  27.      and PKZIP and PKUNZIP can work with files produced by zip.
  28.  
  29.      zip version 1.9 is compatible with pkzip 1.93a.   Note  that
  30.      pkunzip 1.10 cannot extract files produced by pkzip 1.93a or
  31.      zip 1.9. You must use pkunzip 1.93a or unzip 5.0 to  extract
  32.      them.
  33.  
  34.      For a brief help on zip and unzip, run each without specify-
  35.      ing any parameters on the command line.
  36.  
  37.      zip puts one or more compressed files  into  a  single  "zip
  38.      file"  along with information about the files, including the
  39.      name, path if requested, date and time last  modified,  pro-
  40.      tection,  and  check  information  to verify the fidelity of
  41.      each entry.  zip can also be used as a  filter,  compressing
  42.      standard  input  to standard output.  zip can pack an entire
  43.      directory structure in a zip file  with  a  single  command.
  44.      Compression  ratios of 2:1 to 3:1 are common for text files.
  45.      zip has one compression  method  (deflation)  and  can  also
  46.      store  files  without  compression. It automatically chooses
  47.      the better of the two for each file to be compressed.
  48.  
  49.      zip is useful for packaging a set of files to send to  some-
  50.      one  or for distribution; for archiving or backing up files;
  51.      and for saving disk space by temporarily compressing  unused
  52.      files or directories.
  53.  
  54. HOW TO USE ZIP
  55.      The simplest use of zip is as follows:
  56.  
  57.           zip stuff *
  58.  
  59.      This will create the file "stuff.zip" (assuming it does  not
  60.      exist)  and  put  all  the files in the current directory in
  61.      stuff.zip in a compressed form.  The .zip  suffix  is  added
  62.      automatically,  unless  that  file name given contains a dot
  63.      already.  This allows specifying suffixes other than ".zip".
  64.  
  65.      Because of the way the  shell  does  filename  substitution,
  66.      files  that  start  with a "." are not included.  To include
  67.      those as well, you can:
  68.  
  69.           zip stuff .* *
  70.  
  71.      Even this will not include any subdirectories  that  are  in
  72.      the  current  directory.  To zip up an entire directory, the
  73.      command:
  74.  
  75.           zip -r foo foo
  76.  
  77.      will create the file "foo.zip" containing all the files  and
  78.      directories  in  the  directory "foo" that is in the current
  79.      directory. (The first "foo" denotes the zip file, the second
  80.      one  denotes  the  directory.)  The "r" option means recurse
  81.      through the directory structure.   In  this  case,  all  the
  82.      files  and directories in foo are zipped, including the ones
  83.      that start with a ".", since the recursion does not use  the
  84.      shell's  file-name substitution.  You should not use -r with
  85.      the name ".*", since that matches ".." which will attempt to
  86.      zip up the parent directory--probably not what was intended.
  87.  
  88.      You may want to make a zip file that contains the  files  in
  89.      foo,  but  not  record the directory name, foo.  You can use
  90.      the -j (junk path) option to leave off the path:
  91.  
  92.           zip -j foo foo/*
  93.  
  94.      The -y option (only under Unix) will store symbolic links as
  95.      such in the zip file, instead of compressing and storing the
  96.      file referred to in the link.
  97.  
  98.      You might be zipping to save disk space, in which  case  you
  99.      could:
  100.  
  101.           zip -rm foo foo
  102.  
  103.      where the "m" option means "move".  This will delete foo and
  104.      its  contents  after  making  foo.zip.  No deletions will be
  105.      done until the zip  has  completed  with  no  errors.   This
  106.      option  is  obviously more dangerous and should be used with
  107.      care.
  108.  
  109.      If the zip file already exists, these commands will  replace
  110.      existing  or  add new entries to the zip file.  For example,
  111.      if you were really short on disk space, you might  not  have
  112.      enough room simultaneously to hold the directory foo and the
  113.      compressed foo.zip.  In this case, you could do it in steps.
  114.      If  foo  contained  the subdirectories tom, dick, and harry,
  115.      then you could:
  116.  
  117.           zip -rm foo foo/tom
  118.           zip -rm foo foo/dick
  119.           zip -rm foo foo/harry
  120.  
  121.      where the first command would create foo.zip, and  the  next
  122.      two would add to it.  At the completion of each zip command,
  123.      the directory just zipped would be deleted, making  room  in
  124.      which the next zip command could work.
  125.  
  126.      zip will also accept a single dash ("-")  as  the  zip  file
  127.      name,  in  which  case it will write the zip file to stdout,
  128.      allowing the output to be  piped  to  another  program.  For
  129.      example:
  130.  
  131.           zip -r - . | dd of=/dev/nrst0 obs=16k
  132.  
  133.      would write the zip output  directly  to  a  tape  with  the
  134.      specified  block  size  for  the  purpose  of backing up the
  135.      current directory.
  136.  
  137.      zip also accepts a single dash ("-") as the name of  a  file
  138.      to  be  compressed,  in which case it will read the zip file
  139.      from stdin, allowing zip to take input from another program.
  140.      For example:
  141.  
  142.           tar cf - . | zip backup -
  143.  
  144.      would compress the output of the tar command for the purpose
  145.      of backing up the current directory. This generally produces
  146.      better compression than the previous example  using  the  -r
  147.      option, because zip can take advantage of redundancy between
  148.      files. The backup can be restored using the command
  149.  
  150.           unzip -p backup | tar xf -
  151.  
  152.      When no zip file name is given and stdout is not a terminal,
  153.      zip acts as a filter, compressing standard input to standard
  154.      output.  For example,
  155.  
  156.           tar cf - . | zip | dd of=/dev/nrst0
  157.  
  158.      is equivalent to
  159.  
  160.           tar cf - . | zip - - | dd of=/dev/nrst0
  161.  
  162.      Zip archives created in this manner can  be  extracted  with
  163.      the  program  funzip which is provided in the unzip package.
  164.      For example,
  165.  
  166.              dd if=/dev/nrst0 | funzip | tar xvf -
  167.  
  168. MODIFYING EXISTING ZIP FILES
  169.      When given the name of an existing zip file with  the  above
  170.      commands,  zip will replace identically named entries in the
  171.      zip file or add entries for  new  names.   For  example,  if
  172.      foo.zip exists and contains foo/file1 and foo/file2, and the
  173.      directory foo contains the files  foo/file1  and  foo/file3,
  174.      then:
  175.  
  176.           zip -r foo foo
  177.  
  178.      will replace foo/file1  in  foo.zip  and  add  foo/file3  to
  179.      foo.zip.  After this, foo.zip contains foo/file1, foo/file2,
  180.      and foo/file3, with foo/file2 unchanged from before.
  181.  
  182.      When changing an existing zip file, zip will  write  a  tem-
  183.      porary  file with the new contents, and only replace the old
  184.      one when the zip has completed with no errors. You  can  use
  185.      the  -b  option  to specify a different path (usually a dif-
  186.      ferent device) to put the temporary file in.  For example:
  187.  
  188.           zip -b /tmp stuff *
  189.  
  190.      will put the temporary zip file and the  temporary  compres-
  191.      sion  files  in the directory "/tmp", copying over stuff.zip
  192.      in the current directory when done.
  193.  
  194.      If you are only adding entries to a zip file, not replacing,
  195.      and  the -g option is given, then zip grows (appends to) the
  196.      file instead of copying it.  The danger of this is  that  if
  197.      the  operation fails, the original zip file is corrupted and
  198.      lost.
  199.  
  200.      There are two other ways to change or add entries in  a  zip
  201.      file  that  are  restri